package com.solming.leetcode.question;

//翻转一棵二叉树。
public class InvertTree226 {

    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode left = root.left;
        TreeNode right = root.right;

        TreeNode tmp = left;
        root.left = right;
        root.right = tmp;
        invertTree(left);
        invertTree(right);
        return root;
    }
}
